<?php
	require_once '../JSON.php';
	require_once("../config.php");
	require_once("../utils.php");
	require_once(ROOT_DIR_CLASES.'/cCliente.php');

	$args = ($_SERVER['REQUEST_METHOD'] == "POST") ? $_POST : $_GET;
	$json = new Services_JSON();
    $res = 0;
    if (array_key_exists('COMMAND', $args))
	{		
		$cmd = $args['COMMAND'];		
    	switch ($cmd) {
			case "SAVE": 
				$id = $args['ORDERID'];
				$latitud = $args['LATITUD'];
				$longitud = $args['LONGITUD'];								
				$res = BykomCliente::PersistirGeoReference($id, $latitud, $longitud);
				break;			
    	}
	}
	
	$response = $json->encode($res);
    header('Content-Type: text/plain');
    echo $response;
?>